﻿#define _CRT_SECURE_NO_WARNINGS 1

//编程初学者入门训练第十二题
//BC14 出生日期输入输出

#include <stdio.h>

int main() {
    int num = 0;
    int year = 0;
    int month = 0;
    int day = 0;

    scanf("%d", &num);

    day = num % 100;
    num /= 100;
    month = num % 100;
    num /= 100;
    year = num;

    if (month < 10 && day < 10)
        printf("year=%d\nmonth=0%d\ndate=0%d\n", year, month, day);
    else if (month < 10 && day >10)
        printf("year=%d\nmonth=0%d\ndate=%d\n", year, month, day);
    else if (month >= 10 && day < 10)
        printf("year=%d\nmonth=%d\ndate=0%d\n", year, month, day);
    else
        printf("year=%d\nmonth=%d\ndate=%d\n", year, month, day);

    return 0;
}

//这题的其余解法
#include<stdio.h>

int main()
{
    int a, b, c;
    scanf("%4d%2d%2d", &a, &b, &c);
    printf("year=%d\nmonth=%02d\ndate=%02d\n", a, b, c);
}
//通过scanf函数的%m格式控制可以指定输入域宽，输入数据域宽（列数），
//按此宽度截取所需数据；
//通过printf函数的%0格式控制符，输出数值时指定左面不使用的空位置自动填0。